#ifndef PCRE_GREP_H
#define PCRE_GREP_H

#include "pcre2.h"
#include <vector>

namespace Zen{namespace utility{

class CPcreGrep
{
public:
	CPcreGrep(void);
	bool Compile(char* pattern, int iMatchMode=0);
	bool Compile(const wchar_t* pattern, int iMatchMode=0);
	bool Match(char* src ,int srcLen, int& startPos, int& endPos);
	bool Match(const wchar_t* src, int srcLen, int& startPos, int& endPos);
public:
	~CPcreGrep(void);

private:
	pcre            *m_re; 
	pcre_extra		*m_re_e;
	const char      *m_error;
	int             m_erroffset;
};

}}
#endif
